package com.hmall.controller.globalexception;

import com.hmall.mapper.MallHotMapper;
import com.hmall.model.MallHot;
import org.springframework.beans.factory.annotation.Autowired;

import java.sql.Time;
import java.util.List;

public class Test {

    @Autowired
    MallHotMapper mallHotMapper;

    public void main(String args[]){

        List<MallHot> mallHotList = null;
        long time1 = System.currentTimeMillis();
        mallHotList = mallHotMapper.selectMax2();

        long time2 = System.currentTimeMillis();

        long spend1 = time2 - time1;
        System.out.println("通过直接选择出来的最大的两个值花的时间" + spend1);
        long time3 = System.currentTimeMillis();

        long time4 = System.currentTimeMillis();

        long spend2 = time4 - time3;

        System.out.println("通过排序出来的最大的两个值花的时间" + spend2);

    }
}
